home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
MiscKit1.7.1
/
MiscKitArchive.mbox
/
mbox
/
000268_misckit-reques…aska.et.byu.edu_Thu Oct 6 15:20:50 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-10-30
|
4KB
Return-Path: <misckit-request@alaska.et.byu.edu>
Received: from alaska.et.byu.edu by darth.byu.edu (NX5.67d/NX3.0M)
id AA01124; Thu, 6 Oct 94 15:20:40 -0600
Received: from acs1.byu.edu by alaska.et.byu.edu; Thu, 6 Oct 1994 14:56:57 -0600
Received: from DIRECTORY-DAEMON by yvax.byu.edu (PMDF V4.3-10 #7277)
id <01HHYKPTFQ7K9200OH@yvax.byu.edu>; Thu, 06 Oct 1994 14:56:38 -0600 (MDT)
Received: from alaska.et.byu.edu by yvax.byu.edu (PMDF V4.3-10 #7277)
id <01HHYKOQ0HKW93FDZE@yvax.byu.edu>; Thu, 06 Oct 1994 14:55:40 -0600 (MDT)
Received: from acs1.byu.edu by alaska.et.byu.edu; Thu, 6 Oct 1994 14:53:55 -0600
Received: from DIRECTORY-DAEMON by yvax.byu.edu (PMDF V4.3-10 #7277)
id <01HHYKM8IX5C9N68TN@yvax.byu.edu>; Thu, 06 Oct 1994 14:53:38 -0600 (MDT)
Received: from skycat.usask.ca by yvax.byu.edu (PMDF V4.3-10 #7277)
id <01HHYKLTKW5C93G5ED@yvax.byu.edu>; Thu, 06 Oct 1994 14:53:20 -0600 (MDT)
Received: from skatter.USask.Ca.usask.ca (skatter.usask.ca)
by SKYCAT.USask.CA (PMDF V4.3-11 #5952)
id <01HHYKK244FK8Y5DPQ@SKYCAT.USask.CA>; Thu, 06 Oct 1994 14:51:52 -0600 (CST)
Received: from pisces (pisces.usask.ca) by skatter.USask.Ca.usask.ca
(4.1/SMI-4.1) id AA02356; Thu, 6 Oct 94 14:51:39 CST
Received: by pisces (NX5.67e/NX3.0X) id AA02677; Thu, 6 Oct 94 14:51:38 -0600
Received: by NeXT.Mailer (1.100)
Received: by NeXT Mailer (1.100)
Date: Thu, 06 Oct 1994 14:51:38 -0600
From: eric@skatter.usask.ca (Eric Norum)
Subject: MiscString leaks memory when used as a Distributed Object.
To: misckit@byu.edu
Cc: eric@skatter.usask.ca
Message-Id: <9410062051.AA02356@skatter.USask.Ca.usask.ca>
Content-Transfer-Encoding: 7BIT
Ooops. I clicked on the wrong button with my previous letter.
Sorry about that.
Here's the protocol for a simple server:
@protocol CommMethods
- (int)checkInString:(in MiscString *)s;
@end
And here's the implementation:
- (int)checkInString:(MiscString *)s
{
const char *cp = [s stringValue];
return strlen (cp);
}
Every time a client sends one of these messages, the server leaks an amount of
memory equal to the length, including the terminating '\0' byte, of the string
sent by the *previous* message.
Is this leak related to the bug mentioned in the 3.2 release notes:
Known Problems
Reference: 21973
Problem: Server memory not freed for string arguments.
Description: When using Distributed Objects, if you pass a string
(using char * or const char *) as an argument to a
Distributed Objects server, the memory allocated by
the server for this argument is not freed.
Workaround: None.
Here's the call chain, as reported by MallocDebug:
default 0x0625d120 7
_NXDecodeChars,
idecodeData,
-[NXPortPortal decodeData:ofType:],
-[NXMethodSignature decodeMethodRetFrom:withargs:atAddr:],
-[NXProxy forward::],
_objc_msgForward,
-[CommServer checkInString:],
objc_msgSendv
This is a *big* problem if there is, in fact, no workaround.
My server is growing 3.5 megabytes a day........
Eric Norum eric@skatter.usask.ca
Saskatchewan Accelerator Laboratory
University of Saskatchewan
Saskatoon, Canada. NeXTMail accepted.